<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
//取出此期賽程
$arrGamble = getNewGambleData($intLID, 0);
if($arrGamble === false){
	ErrMsgOutputHTML("Error", "", 1);
}
if(sizeof($arrGamble) == 0){
	$arrGamble = getNewGambleData($intLID, 1);
	if($arrGamble === false){
		ErrMsgOutputHTML("Error", "", 1);
	}
}
$intGID = $arrGamble["ID"];
$intEGTime = 0;
if(!empty($intGID)){
	$_strGDate = DateForm($arrGamble["GameDate"], $arrGamble["GameTime"], "Y-m-d", "UToC")."&nbsp;".TimeForm($arrGamble["GameDate"], $arrGamble["GameTime"], "h:i a", "UToC");

	$arrEGTime = explode(":", $arrGamble["EndGameTime"]);
	$arrGDate = explode("-", $arrGamble["GameDate"]);
	$intEGTime = mktime($arrEGTime[0], $arrEGTime[1], $arrEGTime[2], $arrGDate[1], $arrGDate[2], $arrGDate[0]) - time();
}

$arrTmp = explode("-", $arrLotto["Number"]);
for($i = intval($arrTmp[0]); $i <= intval($arrTmp[1]); $i++)$_strNumber .= $i.",";
$_strNumber = substr($_strNumber, 0, strlen($_strNumber) - 1);

$arrMaxOdds = array();
$arrJumpOdds = array();
for($i = 1; $i <= sizeof($_arrBetParam); $i++){
	$arrMaxOdds[] = "MaxOdds[".$i."] = new Array()";
	$arrJumpOdds[] = "arrJumpOdds[".$i."] = new Array()";
	foreach($_arrBetParam[$i] as $intAN => $arrParam){
		$arrMaxOdds[] = "MaxOdds[".$i."][".$intAN."] = ".$arrParam["maxOdds"];
		$arrJumpOdds[] = "arrJumpOdds[".$i."][".$intAN."] = ".$arrParam["StakeJumpRate"];
	}
}
?><!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> <?php print $_strGamble["Title"];?> (Add) </title>
<link rel="stylesheet" href="../../css/backend.css?time=01" type="text/css">
<script language="JavaScript1.2" type="text/javascript" src="/inc/OperateTemp10M<?php print $_intLang?>.js?time=01"></script>
<script language="JavaScript1.2" type="text/javascript" src="/inc/admin_envirset.js"></script>
<script language="JavaScript">
<!--
var Game1 = new Array(), Game2 = new Array(), Game3 = new Array(), Game4 = new Array();
var Game5 = new Array(), Game6 = new Array(), Game7 = new Array(), Game8 = new Array();
var Game9 = new Array(), Game10 = new Array();
var Game11 = new Array(), Game12 = new Array(), Game13 = new Array();
var Game15 = new Array(), Game16 = new Array();
var Game17 = new Array(), Game18 = new Array(), Game19 = new Array(), Game20 = new Array();
var Game21 = new Array(), Game22 = new Array(), Game23 = new Array(), Game24 = new Array();
var Game25 = new Array(), Game26 = new Array(), Game27 = new Array(), Game28 = new Array();
var Game29 = new Array();
var Game30 = new Array(), Game31 = new Array(), Game32 = new Array(), Game33 = new Array(), Game34 = new Array(), Game35 = new Array();
//var strGameTime = "<?php print $_strGDate;?>";
//var strGameNo = "<?php print $arrGamble["SerialNo"];?>";
var intSortPlus = -1;
var strLottoNum = "<?php print $_strNumber;?>";
var arrSpecialNum = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var arrSpecialCon = new Array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
var strLottoID = "<?php print $intLID;?>";
var strBetType = "1,2,3,4";
var intChangeBT = 1;
var RSeconds = 0;
var isEmergency = 0;
var strOnEmergency = "<?php print $_strOperate["OnEmergency"];?>";
var AutoRefreshID = 0;
var intEndGameTime = <?php print (int)$intEGTime;?>;
var sumStake = new Array(), sumPayOff = new Array(), sumCommission = new Array(), sumWStake = new Array();
sumStake[11] = new Array();
sumStake[12] = new Array();
sumStake[13] = new Array();
sumPayOff[11] = new Array();
sumPayOff[12] = new Array();
sumPayOff[13] = new Array();
sumCommission[11] = new Array();
sumCommission[12] = new Array();
sumCommission[13] = new Array();

var strT1 = "<?php print $_strOperate10M["SpecialNumber"];?>", strT5 = "<?php print $_strOperate10M["NormalSpecial1"];?>", strT11 = "<?php print $_strOperate10M["NormalNumber1_4"];?>", strT14 = "<?php print $_strOperate10M["NormalNumberParlays"];?>", strT15 = "<?php print $_strOperate10M["JoinNumber"];?>", strT25 = "<?php print $_strOperate10M["FiveNotWin"];?>", strT29 = "<?php print $_strOperate10M["Mantissa"];?>", strT30 = "<?php print $_strOperate10M["MantissaJN"];?>", strTSG = "<?php print $_strOperate10M["StartGame"];?>";

var SpecialOverNumber = "<?php print $arrLotto["SpecialOverNumber"];?>";
var NormalOverNumber =  "<?php print $arrLotto["NormalOverNumber"];?>";

var MaxOdds = new Array();
var arrJumpOdds = new Array();
<?php 
	print join("; ", $arrMaxOdds).";";
	print join("; ", $arrJumpOdds).";";
?>

var intSortSite = 0;
var isShowAVOdds = "<?php print $isShowAVOdds;?>";
var arrBTTip5 = new Array('<?php print $_strOperate10M["BT5"];?>', '<?php print $_strOperate10M["BT6"];?>', '<?php print $_strOperate10M["BT7"];?>', '<?php print $_strOperate10M["BT8"];?>');
var arrBTTip15 = new Array('<?php print $_strOperate10M["BT15"];?>', '<?php print $_strOperate10M["BT16"];?>', '<?php print $_strOperate10M["BT17"];?>', '<?php print $_strOperate10M["BT18"];?>', '<?php print $_strOperate10M["BT19"];?>', '<?php print $_strOperate10M["BT20"];?>', '<?php print $_strOperate10M["BT21"];?>', '<?php print $_strOperate10M["BT22"];?>', '<?php print $_strOperate10M["BT23"];?>', '<?php print $_strOperate10M["BT24"];?>');
var arrBTTip25 = new Array('<?php print $_strOperate10M["BT25"];?>', '<?php print $_strOperate10M["BT26"];?>', '<?php print $_strOperate10M["BT27"];?>', '<?php print $_strOperate10M["BT28"];?>');

var arrGLineNumToApointNum = new Array();
var arrColorNumber = new Array();

//平碼或特碼初始化
function iniNumber(intBT){
	var arrNumber = new Array();
	switch(intBT){
		case 1:
			document.getElementById("BetList").innerHTML = strLayer1;
			break;

		case 5:
		case 6:
		case 7:
		case 8:
			document.getElementById("BetList").innerHTML = strLayer5.replace(/0508/, intBT);
			document.getElementById("BetList").innerHTML = document.getElementById("BetList").innerHTML.replace(/0508/, intBT);
			break;

		case 25:
		case 26:
		case 27:
		case 28:
			document.getElementById("BetList").innerHTML = strLayer25.replace(/2528/, intBT);
			document.getElementById("BetList").innerHTML = document.getElementById("BetList").innerHTML.replace(/2528/, intBT);
			break;

		default:
			document.getElementById("BetList").innerHTML = strLayer15.replace(/1524/, intBT);
			document.getElementById("BetList").innerHTML = document.getElementById("BetList").innerHTML.replace(/1524/, intBT);
			break;
	}

	arrNumber = strLottoNum.split(",");
	for(var i = 1; i <= arrNumber.length; i++){
		document.getElementById("Num"+i).innerHTML = "<a href=\"JavaScript:StopBet("+intBT+", "+i+")\" class=\"G_Con_Numer_blue\">" + ((i < 10)?"0"+i:i) + "</a>";
		if(isShowAVOdds == "Y")document.getElementById("Num"+i).innerHTML += "<br /><a id=\"AVOdds"+i+"\"></a>";
		document.getElementById("OddsTD"+i).innerHTML = "+&nbsp;<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>&nbsp;-<br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/
	}
	if(intBT != 1){
		GetOdds();
		return;
	}
	document.getElementById("OddOddsTD").innerHTML = "+&nbsp;<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+i+")\">0.00</a>&nbsp;-<br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/
	document.getElementById("EvenOddsTD").innerHTML = "<a class=\"G_Con_Odds\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/

	document.getElementById("OverOddsTD").innerHTML = "+&nbsp;<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+i+")\">0.00</a>&nbsp;-<br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/
	document.getElementById("UnderOddsTD").innerHTML = "<a class=\"G_Con_Odds\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/

	document.getElementById("SumOddOddsTD").innerHTML = "+&nbsp;<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+i+")\">0.00</a>&nbsp;-<br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/
	document.getElementById("SumEvenOddsTD").innerHTML = "<a class=\"G_Con_Odds\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:ShowOddsLayer("+i+")\">0</a>";//0/

	GetOdds();
}

function changEmergency(){
	document.getElementById("EmergencyLink").innerHTML = (isEmergency == 0)?"<?php print $_strOperate10M["EmergencyOff"];//緊急關閉?>":"<?php print $_strOperate10M["EmergencyOpen"];//系統開放?>";
	document.getElementById("EmergencyLink").className = (isEmergency == 0)?"G_Con_Emergency_Off":"G_Con_Emergency_On";
}

function takeEmergency(){
	with(document.getDataForm){
		op.value = "OffAllWager";
		if(isEmergency == 0)if(!confirm("<?php print $_strOperate10M["EmergencyOffAlert"];?>"))return;
		intEmergency.value = (isEmergency == 0)?"1":"0";
		submit();
	}
}

function changSort(){
	intSortPlus *= -1;
	changSortClass();
	RefreshType();
}

function changSortClass(){
	document.getElementById("TenSortLink").innerHTML = (intSortPlus == -1)?"<?php print $_strOperate10M["TenLoseSort"];//十大負值排行?>":"<?php print $_strOperate10M["TenWinSort"];//十大正值排行?>";
	document.getElementById("TenSortTD").className = (intSortPlus == -1)?"G_Con_SortLoseTD":"G_Con_SortWinTD";
}

function ValueSort(arrValue, intValue, intNum, strCon){
	var i = 0, intTmp = 0, intTmp2 = 0, isMoveDown = false, strCon1 = "", strCon2 = "", intNum1 = 0, intNum2 = 0;
	for(i = 0; i < arrValue.length; i++){
		if(isMoveDown == false){
			if(arrValue[i] < intValue){
				intTmp = arrValue[i];
				intNum1 = arrSpecialNum[i];
				strCon1 = arrSpecialCon[i];
				arrValue[i] = intValue;
				arrSpecialNum[i] = intNum;
				arrSpecialCon[i] = strCon;
				isMoveDown = true;
			}
		}else{
			if(isMoveDown == true){
				intTmp2 = arrValue[i];
				intNum2 = arrSpecialNum[i];
				strCon2 = arrSpecialCon[i];
				arrValue[i] = intTmp;
				arrSpecialNum[i] = intNum1;
				arrSpecialCon[i] = strCon1;
				intTmp = intTmp2;
				intNum1 = intNum2;
				strCon1 = strCon2;
			}
		}
	}
	return arrValue;
}

function getPlusMinusForm(intGID, intBT, intNum, flOdds, intSpecial){
	var strCon = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td onclick=\"PlusMinusOdds(1, "+intNum+", "+intBT+","+flOdds+");\" class=\"G_Con_Odds_Plus\">+</td>";
		
	strCon += "<td align=\"center\"><a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+intGID+","+intBT+","+intNum+","+flOdds+","+intSpecial+")\">"+flOdds+"</a></td>";

	strCon += "<td onclick=\"PlusMinusOdds(0, "+intNum+", "+intBT+","+flOdds+");\" class=\"G_Con_Odds_Minus\">-</td></tr></table>";

	return strCon;
}

//顯示數字賠率，給 iframe 用
function ShowNumberOdds(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, OverBetOn, OverBet, OverBetColor, preWin = 0, strClass = "", strCon = "", flOdds = 0, flComm;

	//數字
	var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);
	arrTmpGame	= eval("Game"+intBT);
	flComm = 0.13;

	/********************顯示變顏色區塊********************/
	for(var i = 1; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		if(isShowAVOdds == "Y"){
			var flOdds = (parseFloat(arrTmpGame[i][8]) <= 0.01)?0:((parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]) + parseFloat(arrTmpGame[i][10]) - parseFloat(arrTmpGame[i][8])*flComm) / parseFloat(arrTmpGame[i][8]));
			flOdds = Math.round(flOdds*100) / 100;
			document.getElementById("AVOdds"+i).innerHTML = flOdds;
		}
		strCon = getPlusMinusForm(arrTmpGame[i][1], intBT, intNum, arrTmpGame[i][5], intBT);
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a>";//+arrTmpGame[i][7]+"/"

		document.getElementById("Num"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.getElementById("OddsTD"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
		sumOdds += 1 / parseFloat(arrTmpGame[i][5]);
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		//sumNPayOff += parseFloat(arrTmpGame[i][9]);

		if(maxPayOff < intTmp)maxPayOff = intTmp;
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);

		document.getElementById("OddsTD"+intNum).innerHTML = strCon;
	}

	document.getElementById("SumStakeValue").innerHTML = Math.round(sumStake[intBT])+"<br>("+Math.round(sumWStake[intBT])+")";

	document.getElementById("MaxLose").innerHTML = Math.round(sumStake[intBT] - maxPayOff - sumCommission[intBT]);
	changSortClass();
	for(var i = 0; i < arrSpecialNum.length; i++){
		intNum = arrSpecialNum[i];
		document.getElementById("Sort"+(i+1)).innerHTML = "<a href=\"JavaScript:StopBet(1, "+intNum+")\" class=\"G_Con_Numer_blue\">" + ((intNum < 10)?"0"+intNum:intNum) + "</a>";
		//alert(arrSpecialCon[i]);
		arrSpecialCon[i] = arrSpecialCon[i].replace("ShowOddsLayer", "intSortSite="+(i+1)+";ShowOddsLayer");
		arrSpecialCon[i] = arrSpecialCon[i].replace("ShowOddsLayer", "intSortSite="+(i+1)+";ShowOddsLayer");
		//alert(arrSpecialCon[i]);
		document.getElementById("SortTD"+(i+1)).innerHTML = arrSpecialCon[i];
		document.getElementById("Sort"+(i+1)).className = document.getElementById("Num"+intNum).className+"_Sort";
		document.getElementById("SortTD"+(i+1)).className = document.getElementById("OddsTD"+intNum).className+"_Sort";
	}

	if(intBT != 1)return;
	//單雙
	/********************顯示變顏色區塊********************/
	arrTmpGame	= Game2;
	intBT = 2;

	/********************顯示變顏色區塊********************/

	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "OddOddsTD";
			strTip = "OddTip";
		}else{
			strTD = "EvenOddsTD";
			strTip = "EvenTip";
		}
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		strCon = getPlusMinusForm(arrTmpGame[i][1], intBT, intNum, arrTmpGame[i][5], intBT);
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";//+arrTmpGame[i][7]+"/"

		document.getElementById(strTD).innerHTML = strCon;
		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.getElementById(strTip).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
	}

	//大小
	/********************顯示變顏色區塊********************/
	arrTmpGame	= Game3;
	intBT = 3;

	/********************顯示變顏色區塊********************/

	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "OverOddsTD";
			strTip = "OverTip";
		}else{
			strTD = "UnderOddsTD";
			strTip = "UnderTip";
		}
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		strCon = getPlusMinusForm(arrTmpGame[i][1], intBT, intNum, arrTmpGame[i][5], intBT);
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";//+arrTmpGame[i][7]+"/"

		document.getElementById(strTD).innerHTML = strCon;
		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.getElementById(strTip).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
	}

	//合數單雙
	arrTmpGame	= Game4;
	intBT = 4;

	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "SumOddOddsTD";
			strTip = "SumOddTip";
		}else{
			strTD = "SumEvenOddsTD";
			strTip = "SumEvenTip";
		}
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		strCon = getPlusMinusForm(arrTmpGame[i][1], intBT, intNum, arrTmpGame[i][5], intBT);
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";//+arrTmpGame[i][7]+"/"

		document.getElementById(strTD).innerHTML = strCon;
		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.getElementById(strTip).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
	}
}


//尾數 初始化
function iniMantissa(){
	document.getElementById("ListStatus").innerHTML = strT29;
	document.getElementById("BetList").innerHTML = strLayer29;
	GetOdds();
}

//顯示一般尾數賠率表
function ShowMantissaOdds(){
	var k, arrTmpGame = new Array(), objTD, intTmp = 0, preWin = 0, strClass = "", maxPayOff = 0;
	//一般尾數
	var arrN = new Array(0, 0, 0, 0, 0, 0, 0), maxPayOff = 0;
	arrTmpGame = Game29;
	intBT = 29;
	for(k = 0; k <= 9; k++){
		intTmp = parseFloat(arrTmpGame[k][9]) + parseFloat(arrTmpGame[k][8]);
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		arrN = ValueSort(arrN, intTmp, k, "");

		objTD = document.getElementById("OddsTD29_"+k.toString());
		objTD.innerHTML = getPlusMinusForm(arrTmpGame[k][1], arrTmpGame[k][2], k.toString(), arrTmpGame[k][5], 0) + "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+",0)\">"+Math.round(parseFloat(arrTmpGame[k][8])).toString()+"</a>";//<br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";//+arrTmpGame[k][7]+"/"

		objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark":"";
	}
	document.getElementById("MantissaSumStakeValue").innerHTML = Math.round(sumStake[intBT]);
	for(i = 0; i < arrN.length; i++)maxPayOff += arrN[i];
	document.getElementById("MantissaMaxLose").innerHTML = Math.round(sumStake[intBT] - maxPayOff - sumCommission[intBT]);
}

//平碼 1-4 初始化
function iniNormalNumber1_4(isParlays){
	if(isParlays == 1){
		document.getElementById("ListStatus").innerHTML = strT14;
		document.getElementById("BetList").innerHTML = strLayer14;
	}else{
		document.getElementById("ListStatus").innerHTML = strT11;
		document.getElementById("BetList").innerHTML = strLayer11;
	}
	GetOdds();
}

//顯示平碼 1-4 及過關賠率表
function ShowNormalNumber1_4Odds(isParlays){
	var i, j, k, m, arrBT = new Array(11,  12, 13), arrTmpGame = new Array(), objTD, intID, intMax, intTmp = 0, preWin = 0, strClass = "";
	if(isParlays == 1)arrBT = new Array(11,  12, 13);

	for(m = 0; m < arrBT.length; m++){
		intBT = arrBT[m];
		arrTmpGame = eval("Game" + intBT);
		intMax = 1;
		for(j = 1; j <= 4; j++){
			preWin = sumStake[intBT][j] - sumCommission[intBT][j];

			for(k = 0; k <= intMax; k++){
				intID = j*10 + k;
				objTD = document.getElementById("OddsTD"+intBT.toString()+"_"+intID.toString());
				if(k == 1){
					objTD.innerHTML = "<a class=\"G_Con_Odds\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a>";//+arrTmpGame[intID][7]+"/"
					if(isParlays != 1){
						intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
						strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
						objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin - intTmp).toString()+"</a>";
					}
				}else{
					if(isParlays == 1){
						objTD.innerHTML = "<a class=\"G_Con_Odds\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a>";//+arrTmpGame[intID][7]+"/"
					}else{
						intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
						strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

						objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+","+arrTmpGame[intID][5]+",0)\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin - intTmp).toString()+"</a>";//+arrTmpGame[intID][7]+"/"
					}
				}
				objTD.className = (arrTmpGame[intID][6] == "1")?"G_Con_TD_Dark":"";
			}
		}
	}
	if(isParlays == 1)return;

	for(intBT = 9; intBT <= 10; intBT++){
		arrTmpGame = eval("Game" + intBT);

		preWin = sumStake[intBT] - sumCommission[intBT];
		for(k = 0; k <= 1; k++){
			intID = k;
			objTD = document.getElementById("OddsTD"+intBT.toString()+"_"+intID.toString());
			if(k == 1){
				objTD.innerHTML = "<a class=\"G_Con_Odds\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a>";//+arrTmpGame[intID][7]+"/"

				intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
				strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
				objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin - intTmp).toString()+"</a>";

			}else{
				intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
				strClass = ((preWin-intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

				objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+","+arrTmpGame[intID][5]+",0)\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+Math.round(parseFloat(arrTmpGame[intID][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin - intTmp).toString()+"</a>";//+arrTmpGame[intID][7]+"/"
			}
			objTD.className = (arrTmpGame[intID][6] == "1")?"G_Con_TD_Dark":"";
		}
	}
}


//顯示連碼賠率表
function ShowJoinNumberOdds(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, OverBetOn, OverBet, OverBetColor, preWin = 0, strClass = "", strCon = "", flOdds = 0, flComm;

	//數字
	var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);
	arrTmpGame	= eval("Game"+intBT);
	flComm = 0.13;

	/********************顯示變顏色區塊********************/
	for(var i = 1; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);

		strCon = getPlusMinusForm(arrTmpGame[i][1], intBT, intNum, arrTmpGame[i][5], intBT);
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a>";//+arrTmpGame[i][7]+"/"

		document.getElementById("Num"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.getElementById("OddsTD"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
		sumOdds += 1 / parseFloat(arrTmpGame[i][5]);
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		//sumNPayOff += parseFloat(arrTmpGame[i][9]);

		if(maxPayOff < intTmp)maxPayOff = intTmp;
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);

		document.getElementById("OddsTD"+intNum).innerHTML = strCon;
	}

	document.getElementById("SumStakeValue").innerHTML = Math.round(sumStake[intBT]);
	changSortClass();
	for(var i = 0; i < arrSpecialNum.length; i++){
		intNum = arrSpecialNum[i];
		document.getElementById("Sort"+(i+1)).innerHTML = "<a href=\"JavaScript:StopBet(1, "+intNum+")\" class=\"G_Con_Numer_blue\">" + ((intNum < 10)?"0"+intNum:intNum) + "</a>";
		arrSpecialCon[i] = arrSpecialCon[i].replace("ShowOddsLayer", "intSortSite="+(i+1)+";ShowOddsLayer");
		arrSpecialCon[i] = arrSpecialCon[i].replace("ShowOddsLayer", "intSortSite="+(i+1)+";ShowOddsLayer");
		document.getElementById("SortTD"+(i+1)).innerHTML = arrSpecialCon[i];
		document.getElementById("Sort"+(i+1)).className = document.getElementById("Num"+intNum).className+"_Sort";
		document.getElementById("SortTD"+(i+1)).className = document.getElementById("OddsTD"+intNum).className+"_Sort";
	}
}


//顯示 五不中
function ShowFiveNotWinNumber(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, OverBetOn, OverBet, OverBetColor, preWin = 0, strClass = "", strCon = "", flOdds = 0, flComm;

	//數字
	var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);
	arrTmpGame	= eval("Game"+intBT);
	flComm = 0.13;

	/********************顯示變顏色區塊********************/
	for(var i = 1; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		strCon = getPlusMinusForm(arrTmpGame[i][1], intBT, intNum, arrTmpGame[i][5], intBT);
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+Math.round(parseFloat(arrTmpGame[i][8])).toString()+"</a>";//+arrTmpGame[i][7]+"/"

		document.getElementById("Num"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.getElementById("OddsTD"+intNum).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
		sumOdds += 1 / parseFloat(arrTmpGame[i][5]);
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		//sumNPayOff += parseFloat(arrTmpGame[i][9]);

		if(maxPayOff < intTmp)maxPayOff = intTmp;
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);

		document.getElementById("OddsTD"+intNum).innerHTML = strCon;
	}

	document.getElementById("SumStakeValue").innerHTML = Math.round(sumStake[intBT]);
	changSortClass();
	for(var i = 0; i < arrSpecialNum.length; i++){
		intNum = arrSpecialNum[i];
		document.getElementById("Sort"+(i+1)).innerHTML = "<a href=\"JavaScript:StopBet(1, "+intNum+")\" class=\"G_Con_Numer_blue\">" + ((intNum < 10)?"0"+intNum:intNum) + "</a>";
		arrSpecialCon[i] = arrSpecialCon[i].replace("ShowOddsLayer", "intSortSite="+(i+1)+";ShowOddsLayer");
		arrSpecialCon[i] = arrSpecialCon[i].replace("ShowOddsLayer", "intSortSite="+(i+1)+";ShowOddsLayer");
		document.getElementById("SortTD"+(i+1)).innerHTML = arrSpecialCon[i];
		document.getElementById("Sort"+(i+1)).className = document.getElementById("Num"+intNum).className+"_Sort";
		document.getElementById("SortTD"+(i+1)).className = document.getElementById("OddsTD"+intNum).className+"_Sort";
	}
}


//生肖連 尾數連 初始化
function iniBT3035Numer(intBT){
	document.getElementById("ListStatus").innerHTML = strT30;
	document.getElementById("BetList").innerHTML = strLayer30;
	GetOdds();
}

//顯示 生肖連 尾數連 數字賠率
function ShowBT3035Number(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, OverBetOn, OverBet, OverBetColor, intBT, preWin = 0, strClass = "", strCon = "", flOdds = 0, flComm, intSumStake = 0;// sumPayOff = 0,
	var arrBT = new Array(30, 31, 32, 33, 34, 35);
	var arrBTMinNum = new Array(0, 0, 0, 0, 0, 0);
	var arrBTMaxNum = new Array(9, 9, 9, 9, 9, 9);
	var strTDSite = "";

	for(var i = 0; i < arrBT.length; i++){
		intBT = arrBT[i];
		arrTmpGame = eval("Game" + intBT.toString());
		intSumStake = 0;

		for(var intNum = arrBTMinNum[i]; intNum <= arrBTMaxNum[i]; intNum++){
			strTDSite = intBT.toString() + "_" + intNum.toString();

			strCon = getPlusMinusForm(arrTmpGame[intNum][1], intBT, intNum, arrTmpGame[intNum][5], intNum);
			strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+Math.round(parseFloat(arrTmpGame[intNum][8])).toString()+"</a>";//+arrTmpGame[intNum][7]+"/"

			document.getElementById("Num"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
			document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

			sumOdds += 1 / parseFloat(arrTmpGame[intNum][5]);
			intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
			document.getElementById("OddsTD"+strTDSite).innerHTML = strCon;

			intSumStake += parseFloat(arrTmpGame[intNum][8]);
		}

		document.getElementById("SumWagerTD"+intBT.toString()).innerHTML = Math.round(intSumStake);
	}	//for(var i = 0; i < arrBT.length; i++)
}

//特碼總排名 初始化
function iniBT1NumberSort(intType){
	var strNum = "", objOddsTB, intBT, intNo, i;
	document.getDataForm.OtherMsg.value = "AllSort";

	switch(intType){
		case 15:
			if(null != document.getElementById("TwinTypeSortTD2"))return GetOdds();
			document.getElementById("ListStatus").innerHTML = strT15;
			document.getElementById("BetList").innerHTML = strLayer15Sort;
			var arrBT = new Array(15, 16, 17, 18, 19, 20, 21, 22, 23, 24);
			document.getElementById("TwinBT1").checked = true;
			break;

		case 25:
			if(null != document.getElementById("TwinTypeSortTD3"))return GetOdds();
			document.getElementById("ListStatus").innerHTML = strT25;
			document.getElementById("BetList").innerHTML = strLayer25Sort;
			var arrBT = new Array(25, 26, 27, 28);
			document.getElementById("TwinBT2").checked = true;
			break;

		default:
			if(null != document.getElementById("TwinTypeSortTD1"))return GetOdds();
			document.getElementById("ListStatus").innerHTML = strT1;
			document.getElementById("BetList").innerHTML = strLayer1Sort;
			var arrBT = new Array(1, 5, 6, 7, 8, 29);
			document.getElementById("TwinBT0").checked = true;
			break;
	}
	objOddsTB = document.getElementById("OddsTable");


	with(objOddsTB)	{
		for(intNo = 0; intNo < 10; intNo++){
			newTR = insertRow();
			newTR.className = "G_Con_TR";
			newTR.align = "center";
			
			with(newTR){
				newTD = insertCell();
				newTD.innerHTML = intNo;

				for(i = 0; i < arrBT.length; i++){
					intBT = arrBT[i];
					if(intNo == 0){
						newTD = insertCell();
						newTD.rowSpan = 30;
						newTD.innerHTML = "&nbsp;";
					}

					newTD = insertCell();
					newTD.innerHTML = "<input type='checkbox' name='CB"+intBT+"x' onclick='GetOpTypeNumSort("+intBT+")' disabled>";

					newTD = insertCell();
					newTD.id = 'Num'+intBT+'_'+intNo;
					newTD.innerHTML = "00";

					newTD = insertCell();
					newTD.id = 'OddsTD'+intBT+'_'+intNo;
					newTD.innerHTML = "&nbsp;";
				}
			}
		}
	}
	GetOdds();
}

//顯示 二定位總排名 賠率表
function ShowBT1NumberSort(intType){
	var intNum, strNum, arrTmpGame = new Array(), objOTD, objNTD, intTmp = 0, preWin = 0, strClass = "", intBT, intNo, intTwinSumStake = 0, strLNum = "", strRNum = "", strShowNum = "", i;
	var isShowColor = false;
	switch(intType){
		case 15:
			var arrBT = new Array(15, 16, 17, 18, 19, 20, 21, 22, 23, 24);
			isShowColor = true;
			break;

		case 25:
			var arrBT = new Array(25, 26, 27, 28);
			break;

		default:
			var arrBT = new Array(1, 5, 6, 7, 8, 29);
			break;
	}

	for(i = 0; i < arrBT.length; i++){
		intBT = arrBT[i];
		arrTmpGame = eval("Game" + intBT.toString());
		for(intNo = 0; intNo < 10; intNo++){
			intNum = arrTmpGame[intNo][3];
			strNum = intNum.toString();

			intTmp = parseFloat(arrTmpGame[intNo][9]) + parseFloat(arrTmpGame[intNo][8]);
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			objNTD = document.getElementById("Num"+intBT.toString()+"_"+intNo.toString());
			objOTD = document.getElementById("OddsTD"+intBT.toString()+"_"+intNo.toString());

			strCon = getPlusMinusForm(arrTmpGame[intNo][1], intBT, intNum.toString(), arrTmpGame[intNo][5], intNo);
			strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intNo][1]+","+arrTmpGame[intNo][2]+","+intNum.toString()+",0,"+intNo.toString()+")\">"+Math.round(parseFloat(arrTmpGame[intNo][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";//+arrTmpGame[intNum][7]+"/"

			switch(intBT){
				case 29:
					strShowNum = strNum;
					break;

				default:
					if(isShowColor && parseFloat(arrTmpGame[intNo][8]) > 1){
						var strTmp = "," + intNum + ",";
						if(arrColorNumber[0].indexOf(strTmp) > 0)objNTD.style.backgroundColor = "red";
						if(arrColorNumber[1].indexOf(strTmp) > 0)objNTD.style.backgroundColor = "#FF9900";
						if(arrColorNumber[2].indexOf(strTmp) > 0)objNTD.style.backgroundColor = "#FFFF00";
						if(arrColorNumber[3].indexOf(strTmp) > 0)objNTD.style.backgroundColor = "#FFFFCC";
					}
					if(strNum.length == 1)strNum = "0" + strNum;
					strShowNum = strNum;
					break;
			}

			//if(null == objNTD)alert(intBT.toString()+"_"+intNo.toString());
			objNTD.innerHTML = "<a href='JavaScript:StopBetSort("+intBT.toString()+", "+intNum+", "+arrTmpGame[intNo][6]+")' class='G_Con_Numer_blue' id='NumSB"+intBT.toString()+"_"+intNo.toString()+"'>" + strShowNum + "</a>";
			objNTD.className = "G_Con_TD_Ball";
			objOTD.className = (arrTmpGame[intNo][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

			objOTD.innerHTML = strCon;
		}

		document.getElementById("TwinSumStake"+intBT).innerHTML = sumStake[intBT];
		intTwinSumStake += sumStake[intBT];
	} //for(intBT = 1; intBT <= 6; intBT++){
	document.getElementById("TwinSumStake").innerHTML = intTwinSumStake;
}

function GetBTSort(intBT, strMultiBT){
	var intBTa = 0, i, intNo, arrBT = new Array();
	arrBT = strMultiBT.split(',');

	for(i = 0; i < arrBT.length; i++){
		intBTa = arrBT[i];

		for(intNo = 0; intNo < 10; intNo++){
			document.OddsListForm["CB"+intBTa+"x"][intNo].disabled = (intBTa == intBT)?false:true;
		}
	}
}

//取得操作種類號碼，回傳號碼用逗號組合字串
function GetOpTypeNumSort(strBT){
	var strNum = "", intNo, i, arrBT = new Array();
	var intNum = 0;
	var isSelectNum = false;
	var strSite = "";
	arrBT = strBT.toString().split(',');

	for(i = 0; i < arrBT.length; i++){
		intBT = arrBT[i];

		for(intNo = 0; intNo < 10; intNo++){
			strSite = intBT+"_"+intNo.toString();
			intNum = document.getElementById("NumSB"+strSite).innerHTML*1;

			isSelectNum = false;
			document.getElementById("Num"+strSite).className = 'G_Con_TD_Ball';

			if(isSelectNum == false){
				if(document.OddsListForm["CB"+intBT+"x"][intNo].checked)isSelectNum = true;
			}

			if(isSelectNum){
				strNum += intNum.toString() + ",";
				document.getElementById("Num"+strSite).className = 'G_Con_TD_Ball_Select';
			}
		} //for(i = 0; i < 100; i++)
	}
	return strNum.substr(0, (strNum.length - 1));
}

//雙飛 重置
function ResetTwinNumber(){
	document.OddsListForm.reset();
	//if(intChangeBT != "12")document.getElementById("TwinBT"+intChangeBT).checked = true; 
	if(intChangeBT == 0){
		GetOpTypeNumSort('1,5,6,7,8,29');
		GetBTSort(0, '1,5,6,7,8,29');

	}else if(intChangeBT == -1){
		GetOpTypeNumSort('15,16,17,18,19,20,21,22,23,24');
		GetBTSort(0, '15,16,17,18,19,20,21,22,23,24');

	}else if(intChangeBT == -2){
		GetOpTypeNumSort('25,26,27,28');
		GetBTSort(0, '25,26,27,28');

	}else{
		GetOpTypeNum();
	}
}

//顯示賠率視窗
function ShowOddsLayer(intGID, intBT, intNum, flOdds, intSpecial){
	var strTD = "";
	with(document.OddsLayer){
		op.value = "OddsUpdate";
		GambleID.value = intGID;
		Bet_Type.value = intBT;
		intNumber.value = intNum;
		isSpecial.value = intSpecial;
		Odds.value = flOdds;
	}

	switch(intBT){
		case 1:
		case 5:
		case 6:
		case 7:
		case 8:
		case 15:
		case 16:
		case 17:
		case 18:
		case 19:
		case 20:
		case 21:
		case 22:
		case 23:
		case 24:
		case 25:
		case 26:
		case 27:
		case 28:
			if(document.getDataForm.OtherMsg.value == "AllSort"){
				strTD = "OddsTD"+intBT+"_"+intSpecial;
			}else{
				strTD = "OddsTD"+intNum;
			}
			if(intSortSite != 0)strTD = "SortTD"+intSortSite;
			break;

		case 2:
			strTD = "OddOddsTD";
			break;

		case 3:
			strTD = "OverOddsTD";
			break;

		case 4:
			strTD = "SumOddOddsTD";
			break;

		default:
			strTD = "OddsTD"+intBT+"_"+intNum;
			break;
	}
	odds_win.style.top=document.getElementById(strTD).offsetTop+document.getElementById(strTD).clientHeight+56;
	odds_win.style.left=document.getElementById(strTD).offsetLeft;
	odds_win.style.display = "block";
	close_WagerWin();
}

//關閉賠率視窗
function close_OddsWin(){
	odds_win.style.display = "none";
}
//關閉明細視窗
function close_WagerWin(){
	wager_win.style.display = "none";
}
function OnOff_QuickTable(isOn){
	ExtraSetupTable.style.display = (isOn == 1)?"block":"none";
}
//開放停押，所有號碼和項目
function StopAllBet(isStop, strBT, strNum){
	with(document.getDataForm){
		op.value = "StopBet";
		isStopBet.value = isStop;
		Bet_Type.value = strBT;
		strLottoNumber.value = (strNum == "")?strLottoNum:strNum;
		submit();
	}
}
//開放停押，所有部分號碼
function StopSomeNumerBet(isStop){
	switch(document.getDataForm["Bet_Type"].value){
		case "1,5,6,7,8,29":
		case "15,16,17,18,19,20,21,22,23,24":
		case "25,26,27,28":
			for(var i = 0; i < document.OddsListForm.TwinBTSort.length; i++){
				if(document.OddsListForm.TwinBTSort[i].checked){
					//alert(GetOpTypeNumSort(document.OddsListForm.TwinBTSort[i].value));
					StopAllBet(isStop, document.OddsListForm.TwinBTSort[i].value, GetOpTypeNumSort(document.OddsListForm.TwinBTSort[i].value));
				}
			}
			break;

		default:
			StopAllBet(isStop, document.getDataForm["isSpecial"].value, GetOpTypeNum());
			ResetTwinNumber();
			break;
	}
}
//開放停押，只單一號碼或項目
function StopBet(intBT, intNum){
	var objGame = eval("Game" + intBT);
	with(document.getDataForm){
		isStopBet.value = (objGame[intNum][6] == "0")?1:0;
		op.value = "StopBet";
		Bet_Type.value = intBT;
		strLottoNumber.value = (intBT.toString() == "2" || intBT.toString() == "3" || intBT.toString() == "4" || intBT.toString() == "9" || intBT.toString() == "10")?"0,1":intNum;
		submit();
	}
}
//排行榜，開放停押，只單一號碼或項目
function StopBetSort(intBT, intNum, isStop){
	with(document.getDataForm){
		isStopBet.value = (isStop == 0)?1:0;
		op.value = "StopBet";
		Bet_Type.value = intBT;
		switch(intBT){
			default:
				strLottoNumber.value = intNum;
				break;
		}
		submit();
	}
}
//開放停押，雙飛全部號碼
function StopTwinAllBet(isStop){
	StopAllBet(isStop, strBetType, "");
	ResetTwinNumber();
}
//取得操作種類號碼，回傳號碼用逗號組合字串
function GetOpTypeNum(){
	var i = 0, strNum = "", arrNum = new Array(), intOverNumber = 0;
	var intLNum = 0, intRNum = 0, intSum = 0;
	arrNum = strLottoNum.split(",");//  0 -> 1, 1 -> 2, ...., 48 -> 49
	intOverNumber = SpecialOverNumber;//(document.getDataForm["isSpecial"].value == "4")?NormalOverNumber:SpecialOverNumber;

	for(i = 0; i < arrNum.length; i++){
		if(arrNum[i].length == 1)arrNum[i] = "0" + arrNum[i];
		//是否單號
		if(document.OddsListForm["OpType[3]"].checked){
			//alert(arrNum[i] + "ss"+parseInt(arrNum[i]));
			if(eval(arrNum[i]) % 2 == 1)strNum += arrNum[i] + ",";
		}
		//是否雙號
		if(document.OddsListForm["OpType[4]"].checked){
			if(eval(arrNum[i]) % 2 == 0)strNum += arrNum[i] + ",";
		}
		//是否大號
		if(document.OddsListForm["OpType[5]"].checked){
			if(eval(arrNum[i]) >= parseInt(intOverNumber))strNum += arrNum[i] + ",";
		}
		//是否小號
		if(document.OddsListForm["OpType[6]"].checked){
			if(eval(arrNum[i]) < parseInt(intOverNumber))strNum += arrNum[i] + ",";
		}
	    intLNum = eval(arrNum[i].substr(0,1));
	    intRNum = eval(arrNum[i].substr(1,1));
	    intSum = intLNum + intRNum;
		//是否合單
		if(document.OddsListForm["OpType[7]"].checked){
			if(intSum % 2 == 1)strNum += arrNum[i] + ",";
		}
		//是否合雙
		if(document.OddsListForm["OpType[8]"].checked){
			if(intSum % 2 == 0)strNum += arrNum[i] + ",";
		}
		//是否尾大
		if(document.OddsListForm["OpType[9]"].checked){
			if(intRNum > 4)strNum += arrNum[i] + ",";
		}
		//是否尾小
		if(document.OddsListForm["OpType[10]"].checked){
			if(intRNum <= 4)strNum += arrNum[i] + ",";
		}
	}
	return strNum.substr(0, (strNum.length - 1));
}

//取得賠率樣版
function GetTemplate(){
	if(strLayer1)return;
	with(document.getDataForm){
		op.value = "GetTemplate";
		submit();
	}
}

//取得賠率
function GetOdds(){
	with(document.getDataForm){
		document.getDataForm["Bet_Type"].value = strBetType;
		op.value = "GetOdds";
		submit();
	}
}

/*--判斷特定欄位值是否有填--*/
function isEmpty(str) { 
	for (var i = 0; i < str.length; i++)
		if (" " != str.charAt(i))return false; 
		return true; 
}

function checkOdds(){
	var objOdds = document.OddsLayer.Odds;
	var intBT = parseInt(document.OddsLayer.Bet_Type.value);
	var intNum = parseInt(document.OddsLayer.intNumber.value);
	var intAN = 0;
	if(arrGLineNumToApointNum.length != 0){
		if(null != arrGLineNumToApointNum[intBT][intNum]){
			var intAN = arrGLineNumToApointNum[intBT][intNum];
		}
	}

	window.status = intBT;
	if(isEmpty(objOdds.value)){
		alert("Odds is Empty");
		objOdds.focus();
		return false;
	}else if(isNaN(objOdds.value)){
		alert("Odds is String!!");
		objOdds.focus();
		return false;
	}else if(parseFloat(objOdds.value) <= 0){
		alert("Odds <= 0");
		objOdds.focus();
		return false;
	}else if(parseFloat(objOdds.value) > MaxOdds[intBT][intAN]){
		alert("Error: Odds > "+MaxOdds[intBT][intAN]);
		objOdds.focus();
		return false;
	}
	odds_win.style.display = "none";
	return true;
}

//給選擇樂透種類下拉選單用
function LottoSelect(){
	with(document.OddsListForm){
		target = "_self";
		switch(LottoID.value){
			case "1":
				action = "/k_admin/Operate/index.php";
				break;

			case "2":
			case "3":
			case "6":
			case "7":
			case "8":
				action = "/k_admin/Operate3D/index.php";
				break;

			case "4":
				action = "/k_admin/Operate7Star/index.php";
				break;

			case "5":
				action = "/k_admin/Operate10M/index.php";
				break;
		}
		submit();
	}
}

function ReChangeBet(){
	ChangeBet(intChangeBT);
}

//更改下注種類賠率表
function ChangeBet(intBT){
	close_WagerWin();
	close_OddsWin();
	document.OddsLayer.SpecialNumType.value = "0";
	document.getDataForm.SpecialNumType.value = "0";
	document.getDataForm.OtherMsg.value = "";
	intChangeBT = intBT;
	switch(intBT){
		//特碼總排名
		case 0:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = strT1;
			strBetType = "1,5,6,7,8,29";
			document.getDataForm["Bet_Type"].value = strBetType;
			iniBT1NumberSort(1);
			var objTwinTip = document.getElementById("TwinTip0");
			objTwinTip.style.color = "#FF9900";
			objTwinTip.style.fontSize = "16px";
			objTwinTip.style.fontWeight = "700";
			break;
		//連碼總排名
		case -1:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = strT15;
			strBetType = "15,16,17,18,19,20,21,22,23,24";
			document.getDataForm["Bet_Type"].value = strBetType;
			iniBT1NumberSort(15);
			var objTwinTip = document.getElementById("TwinTip1");
			objTwinTip.style.color = "#FF9900";
			objTwinTip.style.fontSize = "16px";
			objTwinTip.style.fontWeight = "700";
			break;
		//不中總排名
		case -2:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = strT25;
			strBetType = "25,26,27,28";
			document.getDataForm["Bet_Type"].value = strBetType;
			iniBT1NumberSort(25);
			var objTwinTip = document.getElementById("TwinTip2");
			objTwinTip.style.color = "#FF9900";
			objTwinTip.style.fontSize = "16px";
			objTwinTip.style.fontWeight = "700";
			break;
		//特碼
		case 1:
			OnOff_QuickTable(1);
			document.getElementById("ListStatus").innerHTML = strT1;
			strBetType = "1,2,3,4";
			document.getDataForm["Bet_Type"].value = "1,2,3,4";
			document.getDataForm["isSpecial"].value = 1;
			iniNumber(1);
			break;
		//平1-4 特碼
		case 5:
		case 6:
		case 7:
		case 8:
			OnOff_QuickTable(1);
			document.getElementById("ListStatus").innerHTML = arrBTTip5[intBT - 5];
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			document.getDataForm["isSpecial"].value = intBT;
			iniNumber(intBT);
			document.getElementById("TwinTip"+intBT).style.color = "#FF9900";
			document.getElementById("TwinBT"+intBT).checked = true;
			break;
		//連碼
		case 15:
		case 16:
		case 17:
		case 18:
		case 19:
		case 20:
		case 21:
		case 22:
		case 23:
		case 24:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = arrBTTip15[intBT - 15];
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			document.getDataForm["isSpecial"].value = 0;
			iniNumber(intBT);
			document.getElementById("TwinTip"+intBT).style.color = "#FF9900";
			document.getElementById("TwinBT"+intBT).checked = true;
			break;
		//平碼 1-4
		case 11:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = strT11;
			strBetType = "9,10,11,12,13";
			document.getDataForm["Bet_Type"].value = "9,10,11,12,137";
			document.getDataForm["isSpecial"].value = 0;
			iniNormalNumber1_4(0);
			break;
		//平碼 過關
		case 14:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = strT14;
			strBetType = "14";
			document.getDataForm["Bet_Type"].value = "14";
			document.getDataForm["isSpecial"].value = 0;
			iniNormalNumber1_4(1);
			break;
		//五不中
		case 25:
		case 26:
		case 27:
		case 28:
			OnOff_QuickTable(1);
			document.getElementById("ListStatus").innerHTML = arrBTTip25[intBT - 25];
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			document.getDataForm["isSpecial"].value = intBT;
			iniNumber(intBT);
			document.getElementById("TwinTip"+intBT).style.color = "#FF9900";
			document.getElementById("TwinBT"+intBT).checked = true;
			break;
		//尾數
		case 29:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = strT29;
			strBetType = "29";
			document.getDataForm["Bet_Type"].value = "29";
			document.getDataForm["isSpecial"].value = 0;
			iniMantissa();
			break;
		//尾數連
		case 30:
			OnOff_QuickTable(0);
			document.getElementById("ListStatus").innerHTML = strT30;
			strBetType = "30,31,32,33,34,35";
			document.getDataForm["Bet_Type"].value = "30,31,32,33,34,35";
			document.getDataForm["isSpecial"].value = 0;
			iniBT3035Numer(30);
			break;
	}
}


//顯示以開獎表格
function StartGame(){
	var KGame = new Array(), strGID = "", strBT = "";
	close_WagerWin();
	OnOff_QuickTable(0);
	document.getDataForm.op.value = "StartGame";
	document.getElementById("BetList").innerHTML = strLayerStart;
	document.getElementById("ListStatus").innerHTML = strTSG;
	var objOTable = document.getElementById("OddsTable");
	var docloc="getWagerStart.xml.php?LottoID="+strLottoID+"&isStop=0";
	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root == null)return;
	with(objOTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "G_Con_TR";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("GameDate").item(0).text + "&nbsp;" + KGame[i].getElementsByTagName("GameTime").item(0).text;

					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("GameNo").item(0).text;

					newTD = insertCell();
					newTD.align = "left";
					newTD.innerHTML = KGame[i].getElementsByTagName("BetType").item(0).text;

					strGID = KGame[i].getElementsByTagName("GambleID").item(0).text;
					strBT = KGame[i].getElementsByTagName("BID").item(0).text;
					newTD = insertCell();
					newTD.align = "left";
					newTD.id = "OddsTD"+strBT;
					if(document.getDataForm.isRealShow.value == "1"){
						newTD.innerHTML = "<a class=\"G_Con_Bet_Start\" href=\"JavaScript:getWagerData("+strGID+","+strBT+",-1,1)\">"+KGame[i].getElementsByTagName("CountNo").item(0).text+"&nbsp;/&nbsp;"+KGame[i].getElementsByTagName("RateMemStake").item(0).text+"</a>";
					}else{
						newTD.innerHTML = "<a class=\"G_Con_Bet_Start\" href=\"JavaScript:getWagerData("+strGID+","+strBT+",-1,1)\">"+KGame[i].getElementsByTagName("CountNo").item(0).text+"&nbsp;/&nbsp;"+KGame[i].getElementsByTagName("AllMemStake").item(0).text+"</a>";
					}
				}
			}
		}
	}
}
//更改分盤顯示
function ChangeGambleType(obj){
	with(document.getDataForm){
		ChangeGameType.value = "Yes";
		GameType.value = obj.value;
		submit();
		ChangeGameType.value = "No";
	}
}
//重整方式
function RefreshType(){
	if(isEmergency == 1)alert(strOnEmergency);
	with(document.getDataForm){
		if(op.value == "StartGame"){
			StartGame();
		}else{
			GetOdds();
		}
	}
}
//定時重整
function RClock(i){
	if (RSeconds == 0){
		RefreshType();
		RSeconds = i;
	}
	RSeconds --;
	intEndGameTime --;
	if(document.getElementById("RSec"))document.getElementById("RSec").innerHTML = RSeconds;
	if(intEndGameTime == 0){
		document.getElementById("AlertStopWager").innerHTML = "<embed src='Lotto" + strLottoID + ".mp3' hidden='true'>";
	}
	if(intEndGameTime < -10 && AutoRefreshID > 0)clearInterval(AutoRefreshID);
}
//顯示虛貨，實貨方式
function ChangeReal(obj){
	document.getDataForm.isRealShow.value = obj.value;
	document.OddsLayer.isRealShow.value = obj.value;
	RefreshType();
}
//選擇定時時間
function ChangeRefreshSec(strSec){
	if(strSec == "")strSec = "120";
	if(AutoRefreshID > 0)clearInterval(AutoRefreshID);
	RSeconds = strSec*1;
	AutoRefreshID = setInterval("RClock("+strSec+")",1000);
}
//批次用賠率差調整賠率
function PlusMinusOdds(isAdd, intNum, intBT, flOdds){
	var intAN = 0;
	/*if(null != arrGLineNumToApointNum[intBT][intNum]){
		var intAN = arrGLineNumToApointNum[intBT][intNum];
	}*/

	with(document.OddsLayer){
		op.value = "OddsUpdate";
		GapOdds.value = ((isAdd == 1)?"":"-")+arrJumpOdds[intBT][intAN];
		Odds.value = flOdds + parseFloat(GapOdds.value);
		intNumber.value = intNum;
		GambleID.value = document.getDataForm.GambleID.value;
		isSpecial.value = document.getDataForm.isSpecial.value;
		Bet_Type.value = intBT;
		submit();
	}
}
//批次用賠率差調整賠率
function MultiUpdateGapOdds(isAdd){
	with(document.OddsLayer){
		op.value = "MultiOddsUpdate";
		isGapUpdate.value = "1";
		GambleID.value = document.getDataForm.GambleID.value;
		isSpecial.value = document.getDataForm.isSpecial.value;
		Bet_Type.value = document.getDataForm.isSpecial.value;
		switch(document.getDataForm["Bet_Type"].value){
			case "1,5,6,7,8,29":
			case "15,16,17,18,19,20,21,22,23,24":
			case "25,26,27,28":
				for(var i = 0; i < document.OddsListForm.TwinBTSort.length; i++){
					if(document.OddsListForm.TwinBTSort[i].checked){
						strNumber.value = GetOpTypeNumSort(document.OddsListForm.TwinBTSort[i].value);
						Bet_Type.value = document.OddsListForm.TwinBTSort[i].value;
					}
				}
				GapOdds.value = ((isAdd == 1)?"":"-")+document.OddsListForm.GapOddsSort.value;
				break;

			default:
				strNumber.value = GetOpTypeNum();
				GapOdds.value = ((isAdd == 1)?"":"-")+document.OddsListForm.GapOdds.value;
				break;
		}
		submit();
	}
}
//批次調整成同一賠率
function MultiUpdateOneOdds(){
	with(document.OddsLayer){
		op.value = "MultiOddsUpdate";
		isGapUpdate.value = "0";
		GambleID.value = document.getDataForm.GambleID.value;
		isSpecial.value = document.getDataForm.isSpecial.value;
		Bet_Type.value = strBetType;
		switch(document.getDataForm["Bet_Type"].value){
			case "1,5,6,7,8,29":
			case "15,16,17,18,19,20,21,22,23,24":
			case "25,26,27,28":
				for(var i = 0; i < document.OddsListForm.TwinBTSort.length; i++){
					if(document.OddsListForm.TwinBTSort[i].checked){
						strNumber.value = GetOpTypeNumSort(document.OddsListForm.TwinBTSort[i].value);
						Bet_Type.value = document.OddsListForm.TwinBTSort[i].value;
					}
				}
				Odds.value = document.OddsListForm.OddsSort.value;
				break;

			default:
				strNumber.value = GetOpTypeNum();
				Odds.value = document.OddsListForm.Odds.value;
				break;
		}
		if(checkOdds())submit();
	}
}
var KGameDOM;
function getWagerData(GID, intBT, Num, isStop) {
	var KGame = new Array(), strTD = "", intGap = 0;
	var objWTable = document.getElementById("WagerTable");
	var objWLayer = document.getElementById("WagerLayer");
	var strBT = intBT;

	var docloc="getWager.xml.php?GambleID="+GID+"&Bet_Type="+strBT+"&Number="+Num+"&isStop="+isStop+"&isRealShow="+document.getDataForm.isRealShow.value;
	if(document.getDataForm.Bet_Type.value == "14")docloc+="&isParlays=1";
	if((intBT >= 15 && intBT <= 28) || (intBT >= 30 && intBT <= 35))docloc+="&isParlays=2";
	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root != null){
		if(Num == -1){
			strTD = "OddsTD"+intBT;
		}else{
			switch(intBT){
				case 1:
				case 5:
				case 6:
				case 7:
				case 8:
				case 15:
				case 16:
				case 17:
				case 18:
				case 19:
				case 20:
				case 21:
				case 22:
				case 23:
				case 24:
				case 25:
				case 26:
				case 27:
				case 28:
					strTD = "OddsTD"+Num;
					if(intSortSite != 0)strTD = "SortTD"+intSortSite;
					break;

				case 2:
					strTD = "OddOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				case 3:
					strTD = "OverOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				case 4:
					strTD = "SumOddOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				default:
					strTD = "OddsTD"+intBT+"_"+Num;
					break;
			}
		}
		wager_win.style.top=document.getElementById(strTD).offsetTop+document.getElementById(strTD).clientHeight+56+intGap;
		if(document.getElementById("OddsTable").clientWidth < document.getElementById(strTD).offsetLeft + 483){
			wager_win.style.left=document.getElementById(strTD).offsetLeft + document.getElementById(strTD).clientWidth - 487;
		}else{
			wager_win.style.left=document.getElementById(strTD).offsetLeft;
		}
		wager_win.style.display = "block";
		close_OddsWin();
	}else{
		close_WagerWin();
		return;
	}
	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "Account_Con_BG";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.align = "left";
					newTD.innerHTML = KGame[i].getElementsByTagName("BetDate").item(0).text + "&nbsp;" + KGame[i].getElementsByTagName("BetTime").item(0).text + "<br />" + KGame[i].getElementsByTagName("BetNo").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Account").item(0).text;

					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("Content").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					if(KGame[i].getElementsByTagName("OneStake").item(0).text != ""){
						newTD.innerHTML = KGame[i].getElementsByTagName("OneStake").item(0).text + "<br /><br />" + KGame[i].getElementsByTagName("Stake").item(0).text;
					}else{
						newTD.innerHTML = KGame[i].getElementsByTagName("Stake").item(0).text;
					}

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Income").item(0).text;
				}
			}
		}
	}
	objWLayer.style.height = (objWTable.clientHeight > 300)?300:objWTable.clientHeight;
}

function getNowWagerList(){
	window.open("showblack.php?LID="+strLottoID,"BlackWindow_<?php print str_replace(':', '', str_replace('.', '', $_SERVER["HTTP_HOST"])); ?>","toolbar=no,width=540,height=400,top=0,left=0,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}
//-->
</script>
</head>

<body class="Mybody" onload="iniNumber(1);ChangeRefreshSec('120');">
<form action="index.php" target="_self" method="Get" name="OddsListForm">
<table class="G_Table" cellspacing="1" cellpadding="0">
<tr>
	<td colspan="10" class="MyUp">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_Menu">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 1px">
	<tr>
		<td align="left"><a class="G_text"><?php print $_strOperate10M["LottoKind"];//種類：?><?php print MakeLottoSelect($_arrLotto, $intLID, "LottoID", "LottoSelect()", $_intLang)?></a></td>
		<td align="left">
		<select onchange="ChangeReal(this)">
			<option value="0">-<?php print $_strOperate10M["AllBet"];?>-</option>
			<option value="1" selected>-<?php print $_strOperate10M["RealBet"];?>-</option>
		</select>&nbsp;
		<a class="G_text"><?php print $_strOperate10M["RefreshWay"];//更新：?></a>
		<select onchange="ChangeRefreshSec(this.value)">
			<option value="">-No-</option>
			<option value="5">5 sec</option>
			<option value="10">10 sec</option>
			<option value="20">20 sec</option>
			<option value="30">30 sec</option>
			<option value="40">40 sec</option>
			<option value="50">50 sec</option>
			<option value="60">60 sec</option>
		</select>&nbsp;<input type="button" class="submit" value="<?php print $_strOperate10M["Reset"];//重新整理?>" onclick="RefreshType();"> </td>
		<td align="left"><a class="G_text"><?php print $_strOperate10M["LineKind"];//分盤：?></a>
		<select name="GambleType" onchange="ChangeGambleType(this)">
		<?php
			$arrLine = explode(",", $_KSysParam[GambleLineShowSetting]);
			foreach($arrLine as $k => $v){
				if(empty($v))continue;
				if($_data["GameType"] == $k){
					print '<option value="'.$k.'" selected>'.$v.'</option>\n';
				}else{
					print '<option value="'.$k.'">'.$v.'</option>\n';
				}
			}
		?>
		</select>
		</td>
		<td align="right" valign="bottom" width="480" style="font-size: <?php print ($_intLang == 3)?"1":"8";?>px">
		<!--########## 總排名 ##########//-->
			<a href="JavaScript:ChangeBet(0)" id="M_OETG" class="while_link"><?php print $_strOperate10M["AllSort"];//總排名?></a>
			&nbsp;<a class="a_text">|</a>&nbsp;
		<!--########## 特碼 ##########//-->
			<a href="JavaScript:ChangeBet(1)" id="M_OETG" class="while_link"><?php print $_strOperate10M["SpecialNumber"];//特碼?></a>
			&nbsp;<a class="a_text">|</a>&nbsp;
		<!--########## 平碼1-4 ##########//-->
			<a href="JavaScript:ChangeBet(5)" id="M_CS" class="while_link"><?php print $_strOperate10M["NormalSpecial"];//平碼?></a>
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(11)" id="M_CS" class="while_link"><?php print $_strOperate10M["NormalNumber1_4"];//平碼1-4?></a>
		<!--########## 連碼 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(15)" id="M_CS" class="while_link"><?php print $_strOperate10M["JoinNumber"];//連碼?></a>
		<!--########## 平碼過關 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(14)" id="M_CS" class="while_link"><?php print $_strOperate10M["NormalNumberParlays"];//平碼過關?></a>
		<!--########## 尾數 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(29)" id="M_CS" class="while_link"><?php print $_strOperate10M["Mantissa"];//尾數?></a>
		<!--########## 五不中 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(25)" id="M_CS" class="while_link"><?php print $_strOperate10M["FiveNotWin"];//五不中?></a>
		<!--########## 尾數連 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(30)" id="M_CS" class="while_link"><?php print $_strOperate10M["MantissaJN"];//尾數連?></a>
		<!--########## 已開獎 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:StartGame()" id="M_CS" class="while_link"><?php print $_strOperate10M["StartGame"];//已開獎?></a>
		</td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td colspan="10" class="G_OutSubMenu">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_SubMenu">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="left" class="G_SubMenuCon" width="60%"><?php print $_strOperate10M["ListStatus"];//目前表單狀態：?><a id="ListStatus" class="G_Sec">Special Ball</a>&nbsp;--&nbsp;<?php print $_strOperate10M["GameNo"];//期數?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $arrGamble["SerialNo"];?></a>&nbsp;--&nbsp;<?php print $_strOperate10M["GameTime"];//時間?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $_strGDate;?></a></td>
		<td align="center" class="G_SubMenuCon">&nbsp;</td>
		<td align="center" class="G_SubMenuCon">&lt;&lt;<a href="JavaScript:getNowWagerList()"><?php print $_strOperate10M["NowWagerList"];//即時注單?></a>&gt;&gt;</td>
		<td align="right" class="G_SubMenuCon" width="15%"><?php print $_strOperate10M["RefreshSec"];//更新秒數：?><a class="G_Sec" id="RSec">--</a></td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td><span id="BetList"></span></td>
	<td valign="top" id="ExtraSetupTable" style="display: block; background-color: #FFFFFF">
	<table border="0" width="100">
		<tr><td><input type="checkbox" name="OpType[3]" value="Odd"><a class="G_Con_Text_blue"><?php print $_strOperate10M["OddBall"];//單號?></a></td></tr>
		<tr><td><input type="checkbox" name="OpType[4]" value="Even"><a class="G_Con_Text_blue"><?php print $_strOperate10M["EvenBall"];//雙號?></a></td></tr>
		<tr><td><input type="checkbox" name="OpType[5]" value="Over"><a class="G_Con_Text_blue"><?php print $_strOperate10M["OverBall"];//大號?></a></td></tr>
		<tr><td><input type="checkbox" name="OpType[6]" value="Under"><a class="G_Con_Text_blue"><?php print $_strOperate10M["UnderBall"];//小號?></a></td></tr>
		<tr><td><input type="checkbox" name="OpType[7]" value="SumOdd"><a class="G_Con_Text_blue"><?php print $_strOperate10M["SumOddBall"];//合單?></a></td></tr>
		<tr><td><input type="checkbox" name="OpType[8]" value="SumEven"><a class="G_Con_Text_blue"><?php print $_strOperate10M["SumEvenBall"];//合雙?></a></td></tr>
		<tr><td><input type="checkbox" name="OpType[9]" value="SumEven"><a class="G_Con_Text_blue"><?php print $_strOperate10M["MantissaOUO"];//尾大?></a></td></tr>
		<tr><td><input type="checkbox" name="OpType[10]" value="SumEven"><a class="G_Con_Text_blue"><?php print $_strOperate10M["MantissaOUU"];//尾小?></a></td></tr>
		<tr>
			<td>
			<a href="JavaScript: MultiUpdateGapOdds(1)"><img src="/images/k_admin/upbutton.gif" border="3"></a>
			<select name="GapOdds"><option value="0.1">0.1</option><option value="0.2">0.2</option><option value="0.3">0.3</option>
			<option value="0.4">0.4</option><option value="0.5" selected>0.5</option>
			<?php
				for($i = 1; $i <= 5; $i += 0.5){
					print "<option value=\"".$i."\">".$i."</option>";
				}
			?></select>
			<a href="JavaScript: MultiUpdateGapOdds(0)"><img src="/images/k_admin/downbutton.gif" border="3"></a>
			</td>
		</tr>
		<tr><td><input type="text" name="Odds" size="4">&nbsp;<input type="button" class="submit" value="<?php print $_strOperate10M["Send"];?>" onclick="MultiUpdateOneOdds()"></td></tr>
		<tr><td><a href="JavaScript: StopSomeNumerBet(0)" class="G_Con_OpenBet"><?php print $_strOperate10M["OpenBet"];//開放?></a> / <a href="JavaScript: StopSomeNumerBet(1)" class="G_Con_StopBet"><?php print $_strOperate10M["StopBet"];//停押?></a></td></tr>
		<tr><td><br /><br />&lt;&lt;<a href="JavaScript:takeEmergency()" id="EmergencyLink" class=""></a>&gt;&gt;</td></tr>
	</table>
	</td>
</tr>
</table>
</form>

<!----------------------號碼視窗---------------------------->
<div id="odds_win" style="display: none;position:absolute">
<form name="OddsLayer" action="index.php" method="Get" target="getData" onsubmit="return checkOdds();">
<input type="hidden" name="op" value="OddsUpdate">
<input type="hidden" name="rop" value="GetOdds">
<input type="hidden" name="LottoID" value="<?php print $intLID;?>">
<input type="hidden" name="GambleID" value="">
<input type="hidden" name="Bet_Type" value="">
<input type="hidden" name="intNumber" value="">
<input type="hidden" name="strNumber" value="">
<input type="hidden" name="GapOdds" value="">
<input type="hidden" name="isGapUpdate" value="">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="SpecialNumType" value="3">
<table width="120" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr>
	<td bgcolor="#FFFFFF">
		<table width="120" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
			<tr bgcolor="0163A2"> 
				<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;Change Odds</td>
				<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_OddsWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
			</tr>
			<tr bgcolor="#000000"> 
				<td colspan="2" height="1"></td>
			</tr>
        <tr bgcolor="#FFCC66"> 
          <td colspan="2">
		  <table border="0" cellspacing="0" cellpadding="0" width="120">
			  <tr>
				<td width="80" align="center"><input type="text" name="Odds" size="9" onpaste="return event.returnValue = false;"></td>
				<td width="20" align="right"><input type="submit" class="submit" value="<?php print $_strOperate10M["Send"];?>"></td>
			  </tr>
		  </table>
		  </td>
        </tr>
      </table>
    </td>
</tr>
</table>
</form>
</div>
<!----------------------號碼視窗----------------------------> 
<!----------------------下注明細圖層---------------------------->
<div id="wager_win" style="display: none;position:absolute">
<table width="120" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="120" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strOperate10M["WagerList"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_WagerWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2">
<div style="height:300px; overflow:auto; overflow-x:hidden;" id="WagerLayer">
<table id="WagerTable" class="MyTable" cellspacing="1" cellpadding="3" style="width: 483px;">
<tr align="center">
	<td width="60" class="MyTitleL"><?php print $_strOperate10M["WGameTime"];?></td>
	<td width="80" class="MyTitleL"><?php print $_strOperate10M["WAccount"];?></td>
	<td width="170" class="MyTitleL"><?php print $_strOperate10M["WCont"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strOperate10M["WStake"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strOperate10M["WResult"];?></td>
</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
</div>
<!----------------------下注明細圖層---------------------------->
<iframe src="" width="<?php print ($_SESSION["Admin_Info"] -> MemberGroup == 31)?"110":"0";?>" height="<?php print ($_SESSION["Admin_Info"] -> MemberGroup == 31)?"110":"0";?>" name="getData"></iframe>
<form action="index.php" target="getData" name="getDataForm">
<input type="hidden" name="op" value="GetOdds">
<input type="hidden" name="LottoID" value="<?php print $intLID;?>">
<input type="hidden" name="GambleID" value="<?php print $intGID;?>">
<input type="hidden" name="Bet_Type" value="1,2,3,4">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isStopBet" value="1">
<input type="hidden" name="intEmergency" value="0">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="strLottoNumber" value="<?php print $_strNumber;?>">
<input type="hidden" name="ChangeGameType" value="No">
<input type="hidden" name="GameType" value="<?php print $_data["GameType"];?>">
<input type="hidden" name="SpecialNumType" value="3">
<input type="hidden" name="OtherMsg" value="">
</form>

<div id="AlertStopWager"></div>
</body>
</html>